<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
<head>
    <title></title>
    <meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
    <script type="text/javascript">
        <!--
        var ligerTable = null;
        $(function(){
            $('.select-chosen').chosen();
            ligerTable = $('#table').ligerGrid({
                width:'98%',
                enabledSort:false,
                pageSizeOptions:[5,10,20,50,100,200],
                height:'auto',
                alternatingRow:true,
                url:'${base}/${route}/pay/getList',
                delayLoad:false,
                columns:[
                    {display:'公司标识',name:'companyId',id:'companyId',minWidth:100},
                    {display:'注册地行政区划代码',name:'address',id:'address',minWidth:80},
                    {display:'驾驶员发起行程编号',name:'routeId',id:'routeId',minWidth:120},
                    {display:'乘客合乘订单号',name:'orderId',id:'orderId',minWidth:100},
                    {display:'驾驶员手机号',name:'driverPhone',id:'driverPhone',minWidth:100},
                    {display:'机动车驾驶证号',name:'licenseId',id:'licenseId',minWidth:140},
                    {display:'车牌号码',name:'vehicleNo',id:'vehicleNo',minWidth:80},
                    {display:'运价类型编码',name:'fareType',id:'fareType',minWidth:80},
                    {display:'预计上车时间',name:'bookDepartTime',id:'bookDepartTime',minWidth:110},
                    {display:'实际上车时间',name:'departTime',id:'departTime',minWidth:110},
                    {display:'上车地点',name:'departure',id:'departure',minWidth:180},
                    {display:'上车地点经度',name:'depLongitude',id:'depLongitude',minWidth:80},
                    {display:'上车地点纬度',name:'depLatitude',id:'depLatitude',minWidth:80},
                    {display:'下车时间',name:'destTime',id:'destTime',minWidth:110},
                    {display:'下车地点',name:'destination',id:'destination',minWidth:180},
                    {display:'下车地点经度',name:'destLongitude',id:'destLongitude',minWidth:80},
                    {display:'下车地点纬度',name:'destLatitude',id:'destLatitude',minWidth:80},
                    {
                        display:'坐标加密标识',
                        name:'encrypt',
                        id:'encrypt',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.encrypt == 1){
                                return 'GCJ-02测绘局标准';
                            } else if(row.encrypt == 2){
                                return 'WGS84 GPS标准';
                            } else if(row.encrypt == 3){
                                return 'BD-09百度标准';
                            }
                            return '';
                        }
                    },
                    {display:'载客里程',name:'driveMile',id:'driveMile',minWidth:80},
                    {display:'载客时间',name:'driveTime',id:'driveTime',minWidth:80},
                    {display:'实收金额',name:'factPrice',id:'factPrice',minWidth:80},
                    {display:'应收金额',name:'price',id:'price',minWidth:80},
                    {display:'现金支付金额',name:'cashPrice',id:'cashPrice',minWidth:80},
                    {display:'电子支付机构',name:'lineName',id:'lineName',minWidth:80},
                    {display:'电子支付金额',name:'linePrice',id:'linePrice',minWidth:80},
                    {display:'优惠金额',name:'benfitPrice',id:'benfitPrice',minWidth:80},
                    {display:'燃料成本分摊金额',name:'shareFuelFee',id:'shareFuelFee',minWidth:80},
                    {display:'路桥通行分摊金额',name:'shareHighwayToll',id:'shareHighwayToll',minWidth:80},
                    {display:'附加费',name:'passengerTip',id:'passengerTip',minWidth:80},
                    {display:'其他费用分摊金额',name:'shareOther',id:'shareOther',minWidth:80},
                    {display:'结算状态',name:'payState',id:'payState',minWidth:80},
                    {display:'乘客人数',name:'passengerNum',id:'passengerNum',minWidth:80},
                    {display:'乘客结算时间',name:'payTime',id:'payTime',minWidth:110},
                    {display:'订单完成时间',name:'orderMatchTime',id:'orderMatchTime',minWidth:110}

                ],
                onDblClickRow: function (data, rowindex, rowobj){
                    layer.open({
                        title:'${module}',
                        type:2,
                        maxmin:false,
                        area: ['100%', '100%'],
                        content:'${base}/${route}/pay/view/'+data.id
                    });
                }
            });

            function reload(){
                if(ligerTable){
                    var searchKey = $('#txtSearchKey').val();
                    ligerTable.setParm('searchKey',searchKey);
                    ligerTable.reload();
                }
            }
            $('#btnSearch').click(function(){
                reload();
            });
            $('#btnLoc').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    var url='${base}/${route}/pay/loc/'+id;
                    changePage(url);
                }
            });
            $('#btnEdit').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    var url='${base}/${route}/pay/edit/'+id;
                    changePage(url);
                }
            });
            $('#btnRemove').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    layer.confirm('确定要删除吗？',function(){
                        $.ajax({
                            url:'${base}/${route}/pay/remove/'+id,
                            type:'POST',
                            data:{},
                            dataType:'json',
                            success:function(rst){
                                layer.alert(rst.message);
                                if(rst.status=='OK' && ligerTable != null ){
                                    ligerTable.reload();
                                }
                            }
                        });
                    });
                }
            });
        });
        //-->
    </script>
</head>
<body class="$configs["skinName"]">
		<#include "common/breadcrumb.ftl">
<div class="widget-box">
    <div class="widget-header widget-header-flat">
        <h5 class="lighter">
            <i class="fa fa-search"></i>
        ${module}查询
        </h5>
    </div>
    <div class="widget-body">
        <div class="widget-main">
            <div class="row">
                <div class="col-xs-5 col-sm-5">
                    <div class="input-group">
                        <span class="input-group-addon">关键字</span>
                        <input id="txtSearchKey" type="text" class="form-control search-query" placeholder="请输入关键字搜索" />
                        <span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-primary btn-sm">
										查询
										<i class="fa fa-search bigger-110"></i>
									</button>
								</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="widget-box">
    <div class="widget-header">
        <h5 class="lighter">
            <i class="icon-table"></i>
        ${module}列表
        </h5>
        <!--非查询者有该操作-->
				<#if user?exists && viewerRole?exists && user.roleId != viewerRole>
				<div class="widget-toolbar">
                    <button id="btnLoc" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-check-square-o"></i>轨迹
                    </button>

                    <button id="btnRemove" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-trash-o"></i>删除
                    </button>
                </div>
                </#if>
    </div>
    <div class="widget-body">
        <div id="table"><div>
        </div>
        </div>
        </body>
</html>